package com.example.demo.service;

import com.example.demo.entity.AAccessory;
import com.baomidou.mybatisplus.extension.service.IService;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.example.demo.entity.DAccessory;
import com.example.demo.exception.bizException.BizException;

import java.util.List;

/**
* <p>
*  服务类
* </p>
*
* @author cy
* @since 2020-08-01
*/
public interface AAccessoryService {

    /**
    * 分页查询AAccessory
    *
    * @param page     当前页数
    * @param pageSize 页的大小
    * @param factor  搜索关键词
    * @return 返回mybatis-plus的Page对象,其中records字段为符合条件的查询结果
    * @author cy
    * @since 2020-08-01
    */
    Page<AAccessory> listAAccessorysByPage(int page, int pageSize, String factor);

    /**
    * 根据id查询AAccessory
    *
    * @param id 需要查询的AAccessory的id
    * @return 返回对应id的AAccessory对象
    * @author cy
    * @since 2020-08-01
    */
    AAccessory getAAccessoryById(int id);

    /**
     * 根据id查询DAccessory
     *
     * @param id 需要查询的DAccessory的Aid
     * @return 返回对应id的DAccessory对象
     * @author cy
     * @since 2020-08-01
     */
    List<AAccessory> getAAccessoryByAId(int id);

    /**
    * 插入AAccessory
    *
    * @param aAccessory 需要插入的AAccessory对象
    * @return 返回插入成功之后AAccessory对象的id
    * @author cy
    * @since 2020-08-01
    */
    int insertAAccessory(AAccessory aAccessory);

    /**
    * 根据id删除AAccessory
    *
    * @param id 需要删除的AAccessory对象的id
    * @return 返回被删除的AAccessory对象的id
    * @author cy
    * @since 2020-08-01
    */
    int deleteAAccessoryById(int id);

    /**
    * 根据id更新AAccessory
    *
    * @param aAccessory 需要更新的AAccessory对象
    * @return 返回被更新的AAccessory对象的id
    * @author cy
    * @since 2020-08-01
    */
    int updateAAccessory(AAccessory aAccessory);

}
